<!DOCTYPE html>
<html>
<head>
  <title>insert.html</title>

  <meta name="keywords" content="keyword1,keyword2,keyword3">
  <meta name="description" content="this is my page">
  <meta name="content-type" content="text/html; charset=UTF-8">
  <meta http-equiv="Content-type" content="text/html" charset="utf-8"/>

  <script type="text/javascript" src="Jquery/jquery.min.js"></script>


</head>

<body>
<form action="hexu/foryn/Inertm"  method="post"   enctype="multipart/form-data">
  名称：<input type="text" id="user" name="user"><br>
  图片：<input class="fileInput" id="file" type="file" name="image" />
  <input type="submit" value="提交" onclick="return upload()"/>
</form>
<script type="text/javascript">
        function upload(){
        var username = $("#user").val();
        var filename = $("#file").val();
        var url = "/hexu/foryn/Inertm";
            $.ajax({
            url:url,
            type:"post",
            dataType:"json",
            data:{"username":username,"filename":filename},
            success:function(data){
                if(data.success){
                    alert("添加成功");

            }
            }
        });
        }

    </script>
</body>
</html>
